<template>
  <view>
    <view class="card">
      <view class="title item">服务热线</view>
      <view class="phone item">{{ hotTel }}</view>
      <view class="cu-btn btn item" @click="handleCall">立即拨打</view>
    </view>
    <view class="card">
      <view class="title item">在线客服</view>
      <button class="cu-btn btn item"  open-type="contact">联系客服</button>
    </view>
  </view>
</template>

<script>
import Api from "@/utils/Api";

export default {
  name: "help",
  data() {
    return {
      hotTel: null,
      info: null,
    }
  },
  onLoad(options) {
    options = this.core.decodeURIComponentObject(options);
    this.getInfo();
  },
  methods: {
    getInfo() {
      Api.getConfig().then(res => {
        this.info = res
        this.hotTel = res.hotTel
      })
    },
    handleCall() {
      uni.makePhoneCall({phoneNumber: this.hotTel})
    },
  },
}
</script>

<style scoped lang='scss'>
.card {
  background: #FFFFFF;
  border-radius: r(15px);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: r(50px);
  padding-top: r(50px);

  .item {
    margin-bottom: r(50px);
  }

  .title {
    font-size: r(34px);
    color: #8B82B3;
  }

  .desc, .phone {
    font-size: r(28px);
    color: #222222;
  }

  .btn {
    background: #C38C3A;
    border-radius: r(100px);
    color: white;
    font-size: r(36px);
    padding: r(14px 176px);
  }
}
</style>